
from selenium.webdriver import Keys
from selenium.webdriver.common.by import By
from selenium import webdriver
import pytest,time
@pytest.fixture()
def driver():
    driver=webdriver.Edge()
    driver.maximize_window()
    driver.get('http://10.59.9.12:7001/')
    yield driver
    time.sleep(3)
    driver.quit()
def test_a3mall_login(driver):
    driver.find_element(By.XPATH,'/html/body/div[1]/div/div[2]/ul/li[1]/a').click()
    driver.find_element(By.NAME,'username').send_keys('13811033962')
    driver.find_element(By.NAME,'password').send_keys('123456')
    time.sleep(5)
    driver.find_element(By.CLASS_NAME,'finish-btn').click()
    time.sleep(3)
    dy1=driver.find_element(By.XPATH,'/html/body/div[1]/div/div[2]/ul/li[1]/a').text
    print(dy1)
    time.sleep(3)
    driver.find_element(By.XPATH,'/html/body/div[3]/div[2]/ul/li[1]/a').click()
    a=driver.find_element(By.CLASS_NAME,'search-input')
    a.send_keys('宋牌')
    a.send_keys(Keys.ENTER)
    driver.find_element(By.XPATH,'//img[@src="/uploads/images/20250620/67e1bd127f10d17039e45464df4c460a.jpg"]').click()
    driver.find_element(By.ID,'buy-cart').click()
    time.sleep(5)
def test_login_success():
    """测试用户使用正确的用户名和密码能否成功登录系统"""
    pass

